-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable search data from SearchEngine
component
#3037
Enable search data from SearchEngine
component
#3037
Conversation
…' of github.com:argilla-io/argilla into 3017-api-enable-search-data-from-searchengine-component
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM @frascuchon! Just two comments about creating some functions.
src/argilla/server/search_engine.py
Outdated
text_query = { | ||
"combined_fields": { | ||
"query": query.text.q, | ||
"fields": [f"fields.{field.name}" for field in dataset.fields], | ||
"operator": "and", | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could move this to a function returning text_query
as it would be easier to test with unit tests.
src/argilla/server/search_engine.py
Outdated
text_query = { | ||
"match_phrase": { | ||
f"fields.{query.text.field}": { | ||
"query": query.text.q, | ||
"operator": "and", | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
I'll check what is happening with the failing tests, it is related to the changes I introduced in #2993. |
* move text query build logic to a method * Rename `TextFieldQuery` to `TextQuery`
fcf6d1f
to
391f217
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #3037 +/- ##
===========================================
+ Coverage 90.78% 90.80% +0.01%
===========================================
Files 208 208
Lines 11113 11166 +53
===========================================
+ Hits 10089 10139 +50
- Misses 1024 1027 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
# Description Adding `search` functionality to the `SearchEngine` class. This functionality will be integrated with the new search endpoint in another PR. This search applies a basic search over all record fields, or by selecting one of them. ### Update The search pagination will be tackled after the search endpoint integration. Closes #3017 **Type of change** (Please delete options that are not relevant. Remember to title the PR according to the type of change) - [x] Improvement (change adding some improvement to an existing functionality) **How Has This Been Tested** New test cases have been added **Checklist** - [x] I have merged the original branch into my forked branch - [ ] I added relevant documentation - [x] follows the style guidelines of this project - [x] I did a self-review of my code - [ ] I made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [ ] I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/) --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
# Description Adding `search` functionality to the `SearchEngine` class. This functionality will be integrated with the new search endpoint in another PR. This search applies a basic search over all record fields, or by selecting one of them. ### Update The search pagination will be tackled after the search endpoint integration. Closes #3017 **Type of change** (Please delete options that are not relevant. Remember to title the PR according to the type of change) - [x] Improvement (change adding some improvement to an existing functionality) **How Has This Been Tested** New test cases have been added **Checklist** - [x] I have merged the original branch into my forked branch - [ ] I added relevant documentation - [x] follows the style guidelines of this project - [x] I did a self-review of my code - [ ] I made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [ ] I have added relevant notes to the CHANGELOG.md file (See https://keepachangelog.com/) --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Description
Adding
search
functionality to theSearchEngine
class. This functionality will be integrated with the new search endpoint in another PR.This search applies a basic search over all record fields, or by selecting one of them.
Update
The search pagination will be tackled after the search endpoint integration.
Closes #3017
Type of change
(Please delete options that are not relevant. Remember to title the PR according to the type of change)
How Has This Been Tested
New test cases have been added
Checklist